import { http, HttpResponse } from 'msw'

export const userLogin = http.post(
  '/data/ed/user/login',
  async ({ request }) => {
    await new Promise(resolve => {
      setTimeout(resolve, 1000)
    })

    return HttpResponse.json({
      success: true,
      errorCode: '',
      errorMessage: '',
      data: { token: 'mytest111awdwkuiu', userId: 'xxxx' },
    })
  },
)

export const userLogout = http.post('/data/ed/user/logout', () => {
  return HttpResponse.json({
    success: true,
    errorCode: '',
    errorMessage: '',
    message: 'Logged out successfully',
  })
})
